﻿package control
{
    import com.core.*;

    public class DaZiBaoControl extends Control
    {
        private var _cfgs:Object;

        public function DaZiBaoControl(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function update(param1:Obproxy, param2:ProxyChange) : void
        {
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            if (param1.getName() == "dazibao")
            {
                if (param2.property == "check")
                {
                    _loc_3 = param2.newvalue[0];
                    _loc_4 = param2.newvalue[1];
                    if (!this._cfgs)
                    {
                        this._cfgs = ConfigDictionary.data.dazibao;
                    }
                    if (this._cfgs[_loc_3] && this._cfgs[_loc_3][_loc_4])
                    {
                        this.target.showContent(this._cfgs[_loc_3][_loc_4].content);
                    }
                }
                else if (param2.property == "show")
                {
                    this.target.showContent(param2.newvalue);
                }
                else if (param2.property == "close")
                {
                    if (target.visible == true)
                    {
                        target.close();
                    }
                }
            }
            return;
        }// end function

    }
}
